package com.wyu.servlet;

import com.wyu.dao.SelectDao;
import com.wyu.dao.SelectDaoImpl;
import com.wyu.dao.SelectSCDao;
import com.wyu.dao.SelectSCDaoImpl;
import com.wyu.pojo.SC;
import com.wyu.pojo.YG;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

@WebServlet("/SelectScbhServlet")
public class SelectScbhServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String scbh = request.getParameter("scbh");
        System.out.println("食材编号"+scbh);
        HttpSession session = request.getSession();
        SelectSCDao dao = new SelectSCDaoImpl();
        List<SC> list3 = dao.searchscbh(scbh);
        session.setAttribute("sc", list3);
        response.sendRedirect("hwxx.jsp");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
